<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  <style>

  </style>
</head>
<body>
    <div id="app">
        组件使用 <hr>
        <Hello></Hello>//区分
        <!-- 报错 <HeadTitle></HeadTitle> -->
        <head-title></head-title>
    </div>

    <template id="hello">
        <!-- template 中的直接子元素只能有一个 -->
        <!-- <div>1</div>
        <div>2</div> -->
        <div>
            hello
           
        </div>
    </template>
    <template id="head-title">
            <div>
            头部标题           
        </div>
    </template>
    <template id="app-comp">
        <div>
        app        
    </div>
</template>
</body>
<script>
   
    //组件起名：大驼峰[首选] / -连接
Vue.component('Hello',{
    template:'#hello'
});
 Vue.component('HeadTitle',{
    template:'#head-title'
 });
 Vue.component('app-comp',{
    template:'#app-comp'
 });   
   
 new Vue({//创建根组件
   el:"#app",
  
    
   })
</script>
</html>